#include<bits/stdc++.h>
#define ll long long
#define str string
#define db double
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define ms(x,t) memset(x,t,sizeof(x))
using namespace std;
const int maxn = 1000+10;
const int maxm = 5+10;
const ll INF = 0x3f3f3f3f;
const ll mod = 1e9+7;
int n,m,X,Y;
char c[maxn];
ll f[maxn][40][40];
void add(ll &x,ll y) {
	x = (x + y);
	if(x > mod) x -= mod;
}
void Solve() {
	cin >> n >> m >> X;
	for(int i = 0; i < m; i++) {
		cin >> c[i];
		Y |= (1<<i)*(c[i] - '0'); 
	}
	f[0][0][0] = 1;
	int S = (1<<m)-1; 
	for(int i = 1; i <= n; i++) {
		for(int j = 0; j <= S; j++) {
			for(int k = 0; k <= S; k++) {
				for(int l = 0; l <= S; l++) {
					if(i == X && Y != l) continue;
//					cerr<<((k*l)&S)<<' ';
					add(f[i][j^((k*l)&S)][l],f[i-1][j][k]);
				}
//				cerr<<'\n';
			}
		}
	}
	ll ans = 0;
	for(int j = 0; j <= S; j++) {
		for(int k = 0; k <= S; k++) {
//			cerr<<f[n][j][k]<<' ';
			add(ans,f[n][j][k] * j % mod);
		}
//		cerr<<'\n';
	}
	cout<<ans<<'\n';
	return ;
}
/*
975 5 810
00101
8 3 3
011
*/
int main(){
	freopen("pearl.in","r",stdin); freopen("pearl.out","w",stdout);
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//	int tt; cin >> tt; while(tt--)
	Solve();
	return 0;
}


